﻿using ClassLibrary;
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleDemo
{
    public class ExtensionDemo
    {
        public void UseMyExtensionMethod()
        {
            List<Person> personList = new List<Person>()
            {
                new Person(){ID=1,Name="Big Yellow",Age=10},
                new Person(){ID=2,Name="Little White",Age=15},
                new Person(){ID=3,Name="Middle Blue",Age=7}
            };

            var datas = personList.Where(p =>
            {
                return p.Age >= 10;
            });

            foreach (var data in datas)
            {
                Console.WriteLine(data.FormatOutput());
            }
        }
    }
}
